- breadcrumb_title s_('AccessTokens|Access Tokens')
- page_title s_('AccessTokens|Personal Access Tokens')
- type = _('personal access token')
- type_plural = _('personal access tokens')
- @force_desktop_expanded_sidebar = true

.settings-section.settings-section-no-bottom.js-search-settings-section
  .settings-sticky-header
    .settings-sticky-header-inner
      %h4.gl-my-0
        = page_title
  %p.gl-text-secondary
    = s_('AccessTokens|You can generate a personal access token for each application you use that needs access to the GitLab API.')
    = s_('AccessTokens|You can also use personal access tokens to authenticate against Git over HTTP.')
    = s_('AccessTokens|They are the only accepted password when you have Two-Factor Authentication (2FA) enabled.')

  #js-new-access-token-app{ data: { access_token_type: type } }

  = render Pajamas::CardComponent.new(card_options: { class: 'gl-new-card gl-border-b-0 gl-rounded-bottom-left-none gl-rounded-bottom-right-none js-toggle-container js-token-card' }, header_options: { class: 'gl-new-card-header' }, body_options: { class: 'gl-new-card-body' }) do |c|
    - c.with_header do
      .gl-new-card-title-wrapper
        %h3.gl-new-card-title
          = _('Active personal access tokens')
        .gl-new-card-count
          = sprite_icon('token', css_class: 'gl-mr-2')
          %span.js-token-count= @active_access_tokens.size
      .gl-new-card-actions
        = render Pajamas::ButtonComponent.new(size: :small, button_options: { class: 'js-toggle-button js-toggle-content', data: { testid: 'add-new-token-button' } }) do
          = _('Add new token')
    - c.with_body do
      .gl-new-card-add-form.gl-mt-3.gl-display-none.js-toggle-content.js-add-new-token-form
        = render 'shared/access_tokens/form',
            ajax: true,
            type: type,
            path: profile_personal_access_tokens_path,
            token: @personal_access_token,
            scopes: @scopes,
            help_path: help_page_path('user/profile/personal_access_tokens.md', anchor: 'personal-access-token-scopes')

  #js-access-token-table-app{ data: { access_token_type: type, access_token_type_plural: type_plural, initial_active_access_tokens: @active_access_tokens.to_json } }

#js-tokens-app{ data: { tokens_data: tokens_app_data } }
